package com.beiing.tianshuai.tianshuai.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.MyFriendListBean;
import com.beiing.tianshuai.tianshuai.model.MyFriendListModel;
import com.beiing.tianshuai.tianshuai.model.MyFriendListModelImpl;
import com.beiing.tianshuai.tianshuai.view.MyFriendListViewImpl;

/**
 * Created by Jinni on 2017/8/6 0006.
 */

public class MyFriendListPresenter extends BasePresenter implements MyFriendListPresenterImpl, MyFriendListModel.OnRequestListener {

    private MyFriendListModelImpl mModel;
    private MyFriendListViewImpl mView;

    public MyFriendListPresenter(MyFriendListViewImpl view) {
        mModel = new MyFriendListModel(this);
        mView = view;
    }

    @Override
    public void getMyFriendList(String uid) {
        mView.showProgress();
        mModel.getMyFriendList(uid);
    }

    @Override
    public void onSuccess(MyFriendListBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable e) {
        mView.hideProgress();
        mView.onRequestFailed(e);
    }
}
